#include "gui.h"

/** @fn     void drawUI(int collumns)
    @brief  draws the uner interface
    @param  collumns    the amount of collumns for the main window
    @return void
    */
void buildUI(int collumns){
    //clear screen
    system("cls");

    //draw controlbar
    drawBar(0, "< p[R]evious\0", "nex[T] >\0", YELLOW, RED);

    //draw controlbar
    drawBar(tDRAWBAR, "Use the letter within brackets to execute a command", "[H]elp", GREEN, BLUE);

    //draw frame
    drawFrame(1, gWIDTH, gHEIGHT, collumns);

    //draw textboxes
    //int widthTextBox = (gWIDTH/collumns)-1;
    drawTextBox(1, 2 ,15, "word:\0");
    drawTextBox(1, 3 ,15, "count:\0");
    drawTextBox(1, 4 ,15, "length:\0");
    drawTextBox(1, 5 ,15, "index:\0");
}

/** @fn     void guiInit()
    @brief  inits the gui
    @return void
    */
void guiInit(){
    buildUI(1);
    //set cursor to return point and configure standard DOS color
    PlaceCursor(0, 0);
    SetColor(DEFAULT, DEFAULTBG);
}

/** @fn     void guiKill()
    @brief  terminates the gui
    @return void
    */
void guiKill(){
    SetColor(DEFAULT, DEFAULTBG);
    system("cls");
    PlaceCursor(0, 0);
}
